/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.usertobookreserve.model;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import cn.org.rapid_framework.util.DateConvertUtils;

import java.util.*;

import cn.edu.pku.wxlib.usertobookreserve.model.*;
import cn.edu.pku.wxlib.usertobookreserve.service.*;
import cn.edu.pku.wxlib.usertobookreserve.vo.query.*;

import javacommon.base.*;
import javacommon.util.*;
import javacommon.page.Page;

/**
 * @version 1.0
 * @since 1.0
 */


public class Usertobookreserve extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Usertobookreserve";
	public static final String ALIAS_USER_TO_BOOK_RESERVE_ID = "userToBookReserveId";
	public static final String ALIAS_USER_ID = "userId";
	public static final String ALIAS_BOOK_SKUID = "bookSkuid";
	public static final String ALIAS_RESERVE_TIME = "预约时间";
	public static final String ALIAS_FAIL_TIME = "失效时间";
	public static final String ALIAS_REMARK = "remark";
	
	//date formats
	public static final String FORMAT_RESERVE_TIME = DATE_FORMAT;
	public static final String FORMAT_FAIL_TIME = DATE_FORMAT;
	
	//columns START
    /** userToBookReserveId       db_column: userToBookReserveId */	
	
	private java.lang.Integer userToBookReserveId;
    /** userId       db_column: userId */	
	@NotNull 
	private java.lang.Integer userId;
    /** bookSkuid       db_column: bookSKUId */	
	@NotNull 
	private java.lang.Integer bookSkuid;
    /** 预约时间       db_column: reserveTime */	
	
	private java.util.Date reserveTime;
    /** 失效时间       db_column: failTime */	
	
	private java.util.Date failTime;
    /** remark       db_column: remark */	
	@Length(max=256)
	private java.lang.String remark;
	//columns END

	public Usertobookreserve(){
	}

	public Usertobookreserve(
		java.lang.Integer userToBookReserveId
	){
		this.userToBookReserveId = userToBookReserveId;
	}

	public void setUserToBookReserveId(java.lang.Integer value) {
		this.userToBookReserveId = value;
	}
	
	public java.lang.Integer getUserToBookReserveId() {
		return this.userToBookReserveId;
	}
	public void setUserId(java.lang.Integer value) {
		this.userId = value;
	}
	
	public java.lang.Integer getUserId() {
		return this.userId;
	}
	public void setBookSkuid(java.lang.Integer value) {
		this.bookSkuid = value;
	}
	
	public java.lang.Integer getBookSkuid() {
		return this.bookSkuid;
	}
	public String getReserveTimeString() {
		return DateConvertUtils.format(getReserveTime(), FORMAT_RESERVE_TIME);
	}
	public void setReserveTimeString(String value) {
		setReserveTime(DateConvertUtils.parse(value, FORMAT_RESERVE_TIME,java.util.Date.class));
	}
	
	public void setReserveTime(java.util.Date value) {
		this.reserveTime = value;
	}
	
	public java.util.Date getReserveTime() {
		return this.reserveTime;
	}
	public String getFailTimeString() {
		return DateConvertUtils.format(getFailTime(), FORMAT_FAIL_TIME);
	}
	public void setFailTimeString(String value) {
		setFailTime(DateConvertUtils.parse(value, FORMAT_FAIL_TIME,java.util.Date.class));
	}
	
	public void setFailTime(java.util.Date value) {
		this.failTime = value;
	}
	
	public java.util.Date getFailTime() {
		return this.failTime;
	}
	public void setRemark(java.lang.String value) {
		this.remark = value;
	}
	
	public java.lang.String getRemark() {
		return this.remark;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("UserToBookReserveId",getUserToBookReserveId())
			.append("UserId",getUserId())
			.append("BookSkuid",getBookSkuid())
			.append("ReserveTime",getReserveTime())
			.append("FailTime",getFailTime())
			.append("Remark",getRemark())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getUserToBookReserveId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Usertobookreserve == false) return false;
		if(this == obj) return true;
		Usertobookreserve other = (Usertobookreserve)obj;
		return new EqualsBuilder()
			.append(getUserToBookReserveId(),other.getUserToBookReserveId())
			.isEquals();
	}
}

